package com.shengyuan.manage_os.old.ying.erpm.data;

import android.content.Context;

import com.shengyuan.manage_os.old.ying.erpm.db.Actual_JiShi_Table;

public class Machinery extends MenuItem{
	 public String Name;
	 public String PicturePath;
	 public int State; //0待命 1开始 2暂停 3结束����
	 public long HowLongTime;
	 public String ElapsedTime;
	 public String WorksTime;
	 public String TaskName;
	 public String StarTime;
	 public int Id;
	 
	public String getStateName( Context context) {
        Actual_JiShi_Table dbo = new Actual_JiShi_Table(context);
        State = dbo.getState( Name );
        dbo.close();
        
		String name = "";
		switch (State) {
		case 0:	return "待命";
		case 1:	return "开始";
		case 2:	return "暂停";
		case 3:	return "结束";
		}
		return name;
	}
	
	public String getElapsedTime(Context context) {
        Actual_JiShi_Table dbo = new Actual_JiShi_Table(context);
        String time = dbo.getTime( Name );
        dbo.close();
        return time;
	}
	public int getId(Context context) {
        Actual_JiShi_Table dbo = new Actual_JiShi_Table(context);
        int id = dbo.getId( Name );
        dbo.close();
        return id;
	}
}
